#!/bin/sh

# explicitly requested empty root password
case "$GLOBAL_ROOTPW_EMPTY" in
1|y|Y|yes)
	usermod -p "" root
	exit 0
	;;
esac

# set root password if any; no-op if it is empty
if [ -z "$GLOBAL_ROOTPW" ]; then
	echo "** warning: no root password provided, skipping" >&2
else
	echo "$GLOBAL_ROOTPW" | passwd --stdin root
fi
